import { defineStore } from "pinia"
import * as api from "../api/index"

export const useProduct = defineStore('products', {
    state() {
        return {
            products:[],
        }
    },
    
    actions:{
        async fetch_data(){
            try{
                let res = await api.fetchProduct()
                console.log(res.data.data,12356);
                this.products = res.data.data
                console.log(this.products);
            }catch(e){
                console.log(e);
            }
        },
        fetch_product(){

        }

    }
})

    

